package com.tdkj.service.risevalue.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.tdkj.dao.risevalue.IBeanPlateQuotationDao;
import com.tdkj.model.risevalue.BeanPlateQuotation;
import com.tdkj.service.BaseService;
import com.tdkj.service.risevalue.IBeanPlateQuotationService;
            
@Component("plateQuotationService")
public class BeanPlateQuotationServiceImpl extends BaseService implements IBeanPlateQuotationService{
	
	private  IBeanPlateQuotationDao beanPlateQuotationDao;
	                              
	@Resource
	public void setBeanPlateQuotationDao(IBeanPlateQuotationDao beanPlateQuotationDao) {
		this.beanPlateQuotationDao = beanPlateQuotationDao;
	}

	public IBeanPlateQuotationDao geBeanPlateQuotationDao() {
		return beanPlateQuotationDao;
	}

	@Override
	public void add(BeanPlateQuotation bean) {
		beanPlateQuotationDao.save(bean);
	}

	@Override
	public void delete(long id) {
		BeanPlateQuotation bean = beanPlateQuotationDao.findById(id, BeanPlateQuotation.class);
		beanPlateQuotationDao.delete(bean);
	}

	@Override
	public BeanPlateQuotation get(long id) {
		BeanPlateQuotation bean = beanPlateQuotationDao.findById(id, BeanPlateQuotation.class);
		return bean;
	}

	@Override
	public List<BeanPlateQuotation> getAll() {
		return beanPlateQuotationDao.findAll(BeanPlateQuotation.class);
	}

	@Override
	public void update(long id, String name) {
		BeanPlateQuotation bean = beanPlateQuotationDao.findById(id, BeanPlateQuotation.class);
		bean.setName(name);
	}




}
